// Copyright (c) Huawei Technologies Co., Ltd. 2025. All rights reserved.
// This source file is part of the Cangjie project, licensed under Apache-2.0
// with Runtime Library Exception.
//
// See https://cangjie-lang.cn/pages/LICENSE for license information.

#ifndef CANGJIE_MIGRATOR_MIGRATORS_MIGRATOR
#define CANGJIE_MIGRATOR_MIGRATORS_MIGRATOR

#include <memory>
#include <string>

#include "Option.h"
#include "Rules/RuleList.h"

namespace CangjieMigrator {

class Migrator {
public:
    Migrator(const Option &option, std::unique_ptr<Rules::RuleList> rules);
    virtual ~Migrator() = default;

    static std::unique_ptr<Migrator> Create(Path defaultCangjieHome, Option option, std::string version, std::unique_ptr<Rules::RuleList> rules);

    virtual bool Convert() = 0;

    [[nodiscard]] std::string GetVersion() const;

protected:
    const std::string version;
    const std::unique_ptr<Rules::RuleList> rules;
};

}  // namespace CangjieMigrator

#endif // CANGJIE_MIGRATOR_MIGRATORS_MIGRATOR
